package io.github.lee.plugin.depend.impl

import io.github.lee.plugin.depend.Versions
import io.github.lee.plugin.depend.handler.IHandlerDepend
import io.github.lee.plugin.depend.handler.implementation
import org.gradle.api.artifacts.dsl.DependencyHandler

object Retrofit : IHandlerDepend {
    private const val retrofit = "com.squareup.retrofit2:retrofit:${Versions.retrofit}"
    private const val retrofitAdaptersRxjava3 = "com.squareup.retrofit2:adapter-rxjava3:${Versions.retrofit}"
    private const val retrofitConverterGson =
        "com.squareup.retrofit2:converter-gson:${Versions.retrofit}"

    private const val okhttpBom = "com.squareup.okhttp3:okhttp-bom:${Versions.okhttpBom}"
    private const val okhttp3 = "com.squareup.okhttp3:okhttp"
    private const val okhttp3Logging = "com.squareup.okhttp3:logging-interceptor"


    override fun handler(handler: DependencyHandler) {
        handler.implementation(retrofit)
        handler.implementation(retrofitAdaptersRxjava3)
        handler.implementation(retrofitConverterGson)


        handler.implementation(handler.platform(okhttpBom))
        handler.implementation(okhttp3)
        handler.implementation(okhttp3Logging)

    }
}